﻿// <copyright file="IBlogGenericService.cs" company="Clever Software">
// Copyright (c) 2013, 2014 All Right Reserved, http://www.cleversoftware.by
//
// This source is subject to the Microsoft Permissive License.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// </copyright>
// <author>Clever Software</author>
// <email>info@cleversoftware.by</email>
// <date>2014-02-04</date> 
// <summary>CleverCMS source code</summary>

namespace CleverCMS.Blog.Services
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Linq.Expressions;

    public interface IBlogGenericService<T> where T : class
    {
        IQueryable<T> Get(Expression<Func<T, bool>> filter = null, Func<IQueryable<T>, IOrderedQueryable<T>> orderBy = null, string includeProperties = "");

        /// <summary>
        /// Adds the given element to the <see cref="MVCBlog.Core.Repository.IRepository{T}"/>.
        /// </summary>
        /// <param name="entity">The element to add.</param>
        void Add(T entity);

        /// <summary>
        /// Deletes the given element from the <see cref="MVCBlog.Core.Repository.IRepository{T}"/>.
        /// </summary>
        /// <param name="entity">The element to delete.</param>
        void Delete(T entity);

        /// <summary>
        /// Updates the given element in the <see cref="MVCBlog.Core.Repository.IRepository{T}"/>.
        /// </summary>
        /// <param name="entity">The element to update.</param>
        void Update(T entity);

        /// <summary>
        /// Returns the <see cref="MVCBlog.Core.Entities.EntityBase"/> with the given id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns>The <see cref="MVCBlog.Core.Entities.EntityBase"/> with the given id.</returns>
        //T GetById(Guid id);
        T GetById(object id);

        /// <summary>
        /// Returns an <see cref="IEnumerable{T}"/> from the <see cref="MVCBlog.Core.Repository.IRepository{T}"/>.
        /// </summary>
        /// <returns>
        /// The <see cref="IEnumerable{T}"/> of all elements.
        /// </returns>
        IQueryable<T> GetAll();

    }
}